<template>
  <div>
    <el-table :data="tableData" style="width: 100%">
      <el-table-column type="index" label="序号"> </el-table-column>
      <el-table-column prop="date" label="日期"> </el-table-column>
      <el-table-column prop="photo" label="头像">
        <el-avatar shape="square" :size="28" :src="photo"></el-avatar>
      </el-table-column>
      <el-table-column prop="name" label="昵称"> </el-table-column>
      <el-table-column prop="feedback" label="反馈内容" width="300">
      </el-table-column>
      <el-table-column fixed="right" label="操作">
        <template slot-scope="scope">
          <el-button type="text" @click="dialogFormVisible = true"
            >详情</el-button
          >
          <el-button
            @click="deleteRow(scope.$index, tableData)"
            type="text"
            size="small"
            >删除</el-button
          >
        </template>
      </el-table-column>
    </el-table>
    <el-dialog title="反馈详情" :visible.sync="dialogFormVisible" width="50%">
      <el-form
      ref="formappointment"
        :rules="rules"
        :model="formappointment"
        class="demo-form-inline"
        label-width="100px">
        <el-form-item prop="time" label="反馈时间">
          <span>{{formappointment.time}}</span>
        </el-form-item>
        <el-form-item prop="avart" label="头像">
          <el-avatar
            class="photo"
            shape="square"
            :size="30"
            :src="squareUrl"
          ></el-avatar>
        </el-form-item>
        <el-form-item prop="name" label="昵称">
          <span>{{formappointment.name}}</span>
        </el-form-item>
        <el-form-item prop="img" label="反馈图片">
          <el-avatar
            class="photo"
            shape="square"
            :size="74"
            :src="squareUrl"
          ></el-avatar>
        </el-form-item>
        <el-form-item prop="content" label="反馈内容">
          <span>{{formappointment.content}}</span>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">返回</el-button>
        <el-button type="primary" @click="dialogFormVisible = false"
          >确定</el-button
        >
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      formappointment:{
        time:'2022-01-09 08:55',
        name: "lucky",
      content: "我是反馈内容我是反馈内容我是反馈内容我是反馈内容我是反馈内容我是反馈内容我是反馈内容",

      },
      tableData: [
        {
          date: "2022-01-09 08:52",
          photo:
            "https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png",
          name: "lucky",
          feedback:
            "这里是反馈内容，这是反馈内容，这里是反馈内容，这是反馈内容，",
        },
        {
          date: "2022-01-09 08:52",
          photo:
            "https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png",
          name: "lucky",
          feedback:
            "这里是反馈内容，这是反馈内容，这里是反馈内容，这是反馈内容，",
        },
        {
          date: "2022-01-09 08:52",
          photo:
            "https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png",
          name: "lucky",
          feedback:
            "这里是反馈内容，这是反馈内容，这里是反馈内容，这是反馈内容，",
        },
        {
          date: "2022-01-09 08:52",
          photo:
            "https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png",
          name: "lucky",
          feedback:
            "这里是反馈内容，这是反馈内容，这里是反馈内容，这是反馈内容，",
        },
      ],
      dialogFormVisible: false,
      feedbackTimeinput: "2022-01-09 08:55",
      squareUrl:
        "https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png",
    };
  },
  methods: {
    deleteRow(index, rows) {
      this.$confirm("确定删除此条数据吗?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          rows.splice(index, 1);
          this.$message({
            type: "success",
            message: "删除成功!",
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消",
          });
        });
    },
  },
};
</script>

<style scoped>
</style>